﻿<UserControl x:Class="Maths.Tracer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Maths"
             mc:Ignorable="d" Loaded="UserControl_Loaded">
    <UserControl.Resources>
        <Rectangle Width="10" Height="10" x:Key="rect">
            <Rectangle.Fill>
                <DrawingBrush Stretch="Fill">
                    <DrawingBrush.Drawing>
                        <GeometryDrawing>
                            <GeometryDrawing.Geometry>
                                <GeometryGroup>
                                    <LineGeometry StartPoint="0,0" EndPoint="0,1"/>
                                    <LineGeometry StartPoint="0,1" EndPoint="1,1"/>
                                    <LineGeometry StartPoint="1,1" EndPoint="1,0"/>
                                    <LineGeometry StartPoint="1,0" EndPoint="0,0"/>
                                </GeometryGroup>
                            </GeometryDrawing.Geometry>
                            <GeometryDrawing.Pen>
                                <Pen Brush="Red" Thickness="20"></Pen>
                            </GeometryDrawing.Pen>
                        </GeometryDrawing>
                    </DrawingBrush.Drawing>
                </DrawingBrush>
            </Rectangle.Fill>
        </Rectangle>

        <DataTemplate x:Key="Lines">
            <ItemsControl ItemsSource="{Binding}" ItemTemplate="{DynamicResource Columns}">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal"/>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
            </ItemsControl>
        </DataTemplate>
    </UserControl.Resources>
    <ItemsControl x:Name="lst">
        <ItemsControl.ItemTemplate>
            <local:DataTracer2D/>
        </ItemsControl.ItemTemplate>
    </ItemsControl>
</UserControl>
